package com.szcinda.rpa;

import com.szcinda.rpa.netty.NettyServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

@SpringBootApplication(scanBasePackages = "com.szcinda.rpa")
@EnableJpaRepositories(basePackages = "com.szcinda.rpa.repository")
@EntityScan(basePackages = "com.szcinda.rpa.repository")
public class RpaApplication {

    public static void main(String[] args) throws Exception {
        SpringApplication.run(RpaApplication.class, args);
        new NettyServer().bind(63370);
    }

    @Bean
    public PasswordEncoder passwordEncoder(){
        return new BCryptPasswordEncoder();
    }

}
